(function () {
  "use strict";
  var t = {
      6256: function (t, e, n) {
        var i;
        function s(t, e) {
          var n = {};
          switch (t) {
            case "getCookie":
              n = e;
              break;
            case "removeCookie":
              n = e;
              break;
            case "setCookie":
              a(t, e, sendResponse);
              break;
            case "czs":
              n = { userid: i.data.mainUserId, ...e };
              break;
            case "getUserInfo":
              n = { userid: i.data.mainUserId, ...e };
              break;
            case "getToken":
              (i = e),
                (n = {
                  userid: i.data.mainUserId,
                  username: i.data.mainUserName,
                  loginUserName: i.data.loginUserName,
                  key: r.c(i.data.mainUserId + i.data.mainUserName),
                  DG_CHROME_CONFIG: i.DG_CHROME_CONFIG,
                  REQUSET_ID: i.REQUSET_ID,
                });
              break;
            case "post":
              n = { params: e, url: e.url };
              break;
            case "getData":
              n = { params: e, url: e.url };
              break;
          }
          return n;
        }
        function a(t, e, n, i) {
          var s = {};
          (s.targe = t),
            (s.data = e),
            (s.url = i),
            chrome.runtime.sendMessage(s, function (t) {
              n(t);
            });
        }
        n.d(e, {
          A: function () {
            return s;
          },
        });
        var r = {
          rotateLeft: function (t, e) {
            return (t << e) | (t >>> (32 - e));
          },
          addUnsigned: function (t, e) {
            var n, i, s, a, r;
            return (
              (s = 2147483648 & t),
              (a = 2147483648 & e),
              (n = 1073741824 & t),
              (i = 1073741824 & e),
              (r = (1073741823 & t) + (1073741823 & e)),
              n & i
                ? 2147483648 ^ r ^ s ^ a
                : n | i
                ? 1073741824 & r
                  ? 3221225472 ^ r ^ s ^ a
                  : 1073741824 ^ r ^ s ^ a
                : r ^ s ^ a
            );
          },
          F: function (t, e, n) {
            return (t & e) | (~t & n);
          },
          G: function (t, e, n) {
            return (t & n) | (e & ~n);
          },
          H: function (t, e, n) {
            return t ^ e ^ n;
          },
          I: function (t, e, n) {
            return e ^ (t | ~n);
          },
          FF: function (t, e, n, i, s, a, r) {
            return (
              (t = this.addUnsigned(
                t,
                this.addUnsigned(this.addUnsigned(this.F(e, n, i), s), r)
              )),
              this.addUnsigned(this.rotateLeft(t, a), e)
            );
          },
          GG: function (t, e, n, i, s, a, r) {
            return (
              (t = this.addUnsigned(
                t,
                this.addUnsigned(this.addUnsigned(this.G(e, n, i), s), r)
              )),
              this.addUnsigned(this.rotateLeft(t, a), e)
            );
          },
          HH: function (t, e, n, i, s, a, r) {
            return (
              (t = this.addUnsigned(
                t,
                this.addUnsigned(this.addUnsigned(this.H(e, n, i), s), r)
              )),
              this.addUnsigned(this.rotateLeft(t, a), e)
            );
          },
          II: function (t, e, n, i, s, a, r) {
            return (
              (t = this.addUnsigned(
                t,
                this.addUnsigned(this.addUnsigned(this.I(e, n, i), s), r)
              )),
              this.addUnsigned(this.rotateLeft(t, a), e)
            );
          },
          convertToWordArray: function (t) {
            var e,
              n = t.length,
              i = n + 8,
              s = (i - (i % 64)) / 64,
              a = 16 * (s + 1),
              r = Array(a - 1),
              d = 0,
              o = 0;
            while (o < n)
              (e = (o - (o % 4)) / 4),
                (d = (o % 4) * 8),
                (r[e] = r[e] | (t.charCodeAt(o) << d)),
                o++;
            return (
              (e = (o - (o % 4)) / 4),
              (d = (o % 4) * 8),
              (r[e] = r[e] | (128 << d)),
              (r[a - 2] = n << 3),
              (r[a - 1] = n >>> 29),
              r
            );
          },
          wordToHex: function (t) {
            var e,
              n,
              i = "",
              s = "";
            for (n = 0; n <= 3; n++)
              (e = (t >>> (8 * n)) & 255),
                (s = "0" + e.toString(16)),
                (i += s.substr(s.length - 2, 2));
            return i;
          },
          uTF8Encode: function (t) {
            t = t.replace(/\x0d\x0a/g, "\n");
            for (var e = "", n = 0; n < t.length; n++) {
              var i = t.charCodeAt(n);
              i < 128
                ? (e += String.fromCharCode(i))
                : i > 127 && i < 2048
                ? ((e += String.fromCharCode((i >> 6) | 192)),
                  (e += String.fromCharCode((63 & i) | 128)))
                : ((e += String.fromCharCode((i >> 12) | 224)),
                  (e += String.fromCharCode(((i >> 6) & 63) | 128)),
                  (e += String.fromCharCode((63 & i) | 128)));
            }
            return e;
          },
          m: function (t) {
            for (
              var e = [
                  "0",
                  "1",
                  "2",
                  "3",
                  "4",
                  "5",
                  "6",
                  "7",
                  "8",
                  "9",
                  "a",
                  "b",
                  "c",
                  "d",
                  "e",
                  "f",
                ],
                n = "",
                i = 0;
              i < t;
              i++
            ) {
              var s = Math.floor(Math.random() * e.length);
              n += e[s];
            }
            return n;
          },
          c: function (t) {
            var e,
              n,
              i,
              s,
              a,
              r,
              d,
              o,
              h,
              u = this.m(8),
              c = Array(),
              E = 7,
              g = 12,
              f = 17,
              T = 22,
              I = 5,
              S = 9,
              m = 14,
              G = 20,
              U = 4,
              _ = 11,
              F = 16,
              H = 23,
              p = 6,
              l = 10,
              v = 15,
              C = 21;
            for (
              t = this.uTF8Encode(t + "uik76&juy" + u),
                c = this.convertToWordArray(t),
                r = 1732584193,
                d = 4023233417,
                o = 2562383102,
                h = 271733878,
                e = 0;
              e < c.length;
              e += 16
            )
              (n = r),
                (i = d),
                (s = o),
                (a = h),
                (r = this.FF(r, d, o, h, c[e + 0], E, 3614090360)),
                (h = this.FF(h, r, d, o, c[e + 1], g, 3905402710)),
                (o = this.FF(o, h, r, d, c[e + 2], f, 606105819)),
                (d = this.FF(d, o, h, r, c[e + 3], T, 3250441966)),
                (r = this.FF(r, d, o, h, c[e + 4], E, 4118548399)),
                (h = this.FF(h, r, d, o, c[e + 5], g, 1200080426)),
                (o = this.FF(o, h, r, d, c[e + 6], f, 2821735955)),
                (d = this.FF(d, o, h, r, c[e + 7], T, 4249261313)),
                (r = this.FF(r, d, o, h, c[e + 8], E, 1770035416)),
                (h = this.FF(h, r, d, o, c[e + 9], g, 2336552879)),
                (o = this.FF(o, h, r, d, c[e + 10], f, 4294925233)),
                (d = this.FF(d, o, h, r, c[e + 11], T, 2304563134)),
                (r = this.FF(r, d, o, h, c[e + 12], E, 1804603682)),
                (h = this.FF(h, r, d, o, c[e + 13], g, 4254626195)),
                (o = this.FF(o, h, r, d, c[e + 14], f, 2792965006)),
                (d = this.FF(d, o, h, r, c[e + 15], T, 1236535329)),
                (r = this.GG(r, d, o, h, c[e + 1], I, 4129170786)),
                (h = this.GG(h, r, d, o, c[e + 6], S, 3225465664)),
                (o = this.GG(o, h, r, d, c[e + 11], m, 643717713)),
                (d = this.GG(d, o, h, r, c[e + 0], G, 3921069994)),
                (r = this.GG(r, d, o, h, c[e + 5], I, 3593408605)),
                (h = this.GG(h, r, d, o, c[e + 10], S, 38016083)),
                (o = this.GG(o, h, r, d, c[e + 15], m, 3634488961)),
                (d = this.GG(d, o, h, r, c[e + 4], G, 3889429448)),
                (r = this.GG(r, d, o, h, c[e + 9], I, 568446438)),
                (h = this.GG(h, r, d, o, c[e + 14], S, 3275163606)),
                (o = this.GG(o, h, r, d, c[e + 3], m, 4107603335)),
                (d = this.GG(d, o, h, r, c[e + 8], G, 1163531501)),
                (r = this.GG(r, d, o, h, c[e + 13], I, 2850285829)),
                (h = this.GG(h, r, d, o, c[e + 2], S, 4243563512)),
                (o = this.GG(o, h, r, d, c[e + 7], m, 1735328473)),
                (d = this.GG(d, o, h, r, c[e + 12], G, 2368359562)),
                (r = this.HH(r, d, o, h, c[e + 5], U, 4294588738)),
                (h = this.HH(h, r, d, o, c[e + 8], _, 2272392833)),
                (o = this.HH(o, h, r, d, c[e + 11], F, 1839030562)),
                (d = this.HH(d, o, h, r, c[e + 14], H, 4259657740)),
                (r = this.HH(r, d, o, h, c[e + 1], U, 2763975236)),
                (h = this.HH(h, r, d, o, c[e + 4], _, 1272893353)),
                (o = this.HH(o, h, r, d, c[e + 7], F, 4139469664)),
                (d = this.HH(d, o, h, r, c[e + 10], H, 3200236656)),
                (r = this.HH(r, d, o, h, c[e + 13], U, 681279174)),
                (h = this.HH(h, r, d, o, c[e + 0], _, 3936430074)),
                (o = this.HH(o, h, r, d, c[e + 3], F, 3572445317)),
                (d = this.HH(d, o, h, r, c[e + 6], H, 76029189)),
                (r = this.HH(r, d, o, h, c[e + 9], U, 3654602809)),
                (h = this.HH(h, r, d, o, c[e + 12], _, 3873151461)),
                (o = this.HH(o, h, r, d, c[e + 15], F, 530742520)),
                (d = this.HH(d, o, h, r, c[e + 2], H, 3299628645)),
                (r = this.II(r, d, o, h, c[e + 0], p, 4096336452)),
                (h = this.II(h, r, d, o, c[e + 7], l, 1126891415)),
                (o = this.II(o, h, r, d, c[e + 14], v, 2878612391)),
                (d = this.II(d, o, h, r, c[e + 5], C, 4237533241)),
                (r = this.II(r, d, o, h, c[e + 12], p, 1700485571)),
                (h = this.II(h, r, d, o, c[e + 3], l, 2399980690)),
                (o = this.II(o, h, r, d, c[e + 10], v, 4293915773)),
                (d = this.II(d, o, h, r, c[e + 1], C, 2240044497)),
                (r = this.II(r, d, o, h, c[e + 8], p, 1873313359)),
                (h = this.II(h, r, d, o, c[e + 15], l, 4264355552)),
                (o = this.II(o, h, r, d, c[e + 6], v, 2734768916)),
                (d = this.II(d, o, h, r, c[e + 13], C, 1309151649)),
                (r = this.II(r, d, o, h, c[e + 4], p, 4149444226)),
                (h = this.II(h, r, d, o, c[e + 11], l, 3174756917)),
                (o = this.II(o, h, r, d, c[e + 2], v, 718787259)),
                (d = this.II(d, o, h, r, c[e + 9], C, 3951481745)),
                (r = this.addUnsigned(r, n)),
                (d = this.addUnsigned(d, i)),
                (o = this.addUnsigned(o, s)),
                (h = this.addUnsigned(h, a));
            var R =
              u +
              this.wordToHex(r) +
              this.wordToHex(d) +
              this.wordToHex(o) +
              this.wordToHex(h);
            return R.toLowerCase();
          },
        };
      },
      6107: function (t, e, n) {
        function i(t, e) {
          var n = document.createElement("script");
          (n.type = "text/javascript"),
            (n.onload = function () {
              e();
            }),
            (n.src = t),
            document.body.appendChild(n);
        }
        n.d(e, {
          A: function () {
            return i;
          },
        });
      },
    },
    e = {};
  function n(i) {
    var s = e[i];
    if (void 0 !== s) return s.exports;
    var a = (e[i] = { exports: {} });
    return t[i](a, a.exports, n), a.exports;
  }
  !(function () {
    n.d = function (t, e) {
      for (var i in e)
        n.o(e, i) &&
          !n.o(t, i) &&
          Object.defineProperty(t, i, { enumerable: !0, get: e[i] });
    };
  })(),
    (function () {
      n.o = function (t, e) {
        return Object.prototype.hasOwnProperty.call(t, e);
      };
    })();
  var i = n(6107),
    s = n(6256),
    a = setInterval(() => {
      if (document.body) {
        clearInterval(a);
        var t = document.createElement("srcipt");
        (t.id = "dgds_version"),
          (t.innerHTML = chrome.runtime.getManifest().version),
          document.getElementsByTagName("head")[0].appendChild(t),
          (0, i.A)(chrome.runtime.getURL("js/inject.js"), function () {}),
          (0, i.A)(
            chrome.runtime.getURL("js/intercepterFetch.js"),
            function () {}
          );
      }
    });
  if (
    (window.addEventListener("message", (t) => {
      if ("DG_REQUEST_BY_POSTMESSAGE" === t.data.type) {
        var e = (0, s.A)(t.data.targe, t.data.data);
        chrome.runtime.sendMessage(
          { type: "DG_POSTMESSAGE_FROM_CONTENT", data: e, targe: t.data.targe },
          (e) => {
            t.source.postMessage(
              {
                type: "DG_POSTMESSAGE_RESPONSE_" + t.data.data.ptType,
                data: e,
                REQUSET_ID: t.data.data.REQUSET_ID,
                mesFrom: t.data.data.mesFrom,
                requestType: t.data.data.requestType,
              },
              t.origin
            );
          }
        );
      } else
        "DG_REQUEST_BY_POSTMESSAGE_XLSX" === t.data.type &&
          chrome.runtime.sendMessage(
            {
              type: "DG_POSTMESSAGE_FROM_CONTENT_XLSX",
              data: t.data.data,
              targe: t.data.targe,
            },
            (e) => {
              t.source.postMessage(
                {
                  type: "DG_POSTMESSAGE_RESPONSE_XLSX_" + t.data.data.ptType,
                  data: e,
                  REQUSET_ID: t.data.data.REQUSET_ID,
                },
                t.origin
              );
            }
          );
    }),
    location.href.includes("indexnew.html"))
  ) {
    var r = window.sessionStorage.getItem("amtoken");
    r && chrome.runtime.sendMessage({ type: "TSET_A_RESPONSE", data: r });
  }
  (function () {
    const t = window.postMessage;
    (window.getPOSTHANDLER = function () {
      return t;
    }),
      window.addEventListener(
        "message",
        function (t) {
          if (t.source === window)
            if (t.data.TYPE && "PAGE_REQUEST" === t.data.TYPE) {
              const e = JSON.parse(t.data.TEXTDATA),
                n = t.data.REQUESET_ID;
              (function (t, e) {
                return new Promise((n, i) => {
                  const s = { CONFIG: t, ACTION: e };
                  chrome.runtime.sendMessage(s, function (t) {
                    n(t);
                  });
                });
              })(e, t.data.ACTION).then((t) => {
                window.postMessage(
                  { TYPE: "PAGE_RESPONSE", REQUESET_ID: n, RESULT: t },
                  "*"
                );
              });
            } else if (
              t.data.TYPE &&
              "PAGE_REQUEST_CONTENT_GET_SCRIPT" === t.data.TYPE
            ) {
              const e = t.data.TEXTDATA,
                n = t.data.REQUESET_ID;
              $.getScript(e.url, function () {
                window.postMessage(
                  {
                    TYPE: "PAGE_RESPONSE_CONTENT_GET_SCRIPT",
                    REQUESET_ID: n,
                    RESULT: { isOk: !0, data: {} },
                  },
                  "*"
                );
              });
            }
        },
        !1
      );
  })();
})();
